<?php 
	namespace app\data\model;

	use think\Model;

	/**
	* 规格模型
	*/
	class ShopSpec extends Model
	{
		/**
		 * 规格属性
		 * @return [type] [description]
		 */
		public function spec_attr()
		{
			return $this->hasMany('ShopCatesAttr','spec_id');
		}

		/**
		 * 按条件查询所有规格
		 * @return [type] [description]
		 */
		public function all_spec_where($id)
		{
			$data = $this->where('model_id',$id)->select();
			return $data;
		}
	}